package com.yb.interview;

public class Sf1 {
	public static void main(String[] args) {
		int[] a = {1,2,3,4,5,6,7,8,9};
		if (a.length<2) {
			System.out.println(a.toString());
		}
		int i = 0;
		int j = a.length-1;
		while(i<j){
			while(i<j && (a[i]&1)==1){
				i++;
			}
			while(i<j && (a[j]&1)==0){
				j--;
			}
			if (i<j) {
				int temp = a[i];
				a[i] = a[j];
				a[j] = temp;
			}
		}
		for (int x = 0; x < a.length; x++) {
			System.out.print(a[x]);
		}
		
	}
}
